export default class MessageStore {
    private static localStorage: string[] = [];

    static setValue(val:string) {
        this.localStorage.push(val);
    }

    static getValues(): string[] {
        return this.localStorage;
    }

    static getPreviousValue(index: number = 0): string {
        return this.getValues()[this.localStorage.length - 2 - index];
    }

    static getValue(id: number): string {
        if(id >= this.localStorage.length || id < 0) return 'Value id out of range';
        return this.localStorage[id];
    }
}